/*
 * table行展开之后里面的内容
 * @Author: ljb
 * @Date: 2018-01-10 16:07:59
 * @Last Modified by: kanglin
 * @Last Modified time: 2018-06-07 18:50:59
 */
<style lang="less" rel="stylesheet/less" type="text/less" scoped>
    .expand-row{
        margin-bottom: 16px;
    }
    .row-data {
        margin-bottom: 10px;
    }
    img {
        width: 100px;
        vertical-align: text-top;
    }
</style>
<template>
	<div>
		<Row class="expand-row">
			<i-col span="24">
				<span class="expand-key">{{ $t('overall.has_assets') }}: </span>
				<span class="expand-value">{{ row.assets.length + $t('overall.kind') }}</span>
			</i-col>
		</Row>
		<Row
			v-for="asset in row.assets"
			:key="asset.id"
			class="row-data">
			<i-col span="6">
				<span class="expand-key">{{ $t('overall.assets_code') }}：</span>
				<span class="expand-value">{{ asset.code || $t('common.unknown') }}</span>
			</i-col>
			<i-col span="18">
				<Row>
					<i-col span="2">
						<span class="expand-key">{{ $t('overall.relative_product') }}：</span>
					</i-col>
					<i-col span="22">
						<div v-if="asset.products && asset.products.length > 0">
							<Row
								v-for="product in asset.products"
								:key="product.id"
								:gutter="20">
								<i-col span="4">
									<span class="expand-key">{{ $t('overall.product_name') }}: </span>
									<span class="expand-value">{{ product.title || $t('common.unknown') }}</span>
								</i-col>
								<i-col span="4">
									<span class="expand-key">{{ $t('overall.product_code') }}: </span>
									<span class="expand-value">{{ product.spu_code || $t('common.unknown') }}</span>
								</i-col>
								<i-col span="3">
									<span class="expand-key">{{ $t('overall.product_price') }}: </span>
									<span class="expand-value">{{ product.sell_price || $t('common.unknown') }}</span>
								</i-col>
								<i-col span="3">
									<span class="expand-key">{{ $t('overall.product_stock') }}: </span>
									<span class="expand-value">{{ product.stock || $t('common.unknown') }}</span>
								</i-col>
								<i-col span="4">
									<span class="expand-key">{{ $t('overall.tb_link') }}: </span>
									<a
										:href="product.taobao_url || 'javascript:void(0)'"
										target="_blank"
										class="expand-value">{{ product.taobao_url || $t('common.unknown') }}</a>
								</i-col>
								<i-col span="6">
									<span class="expand-key">{{ $t('overall.product_thumb') }}: </span>
									<img
										:src="product.thumb_image.key"
										alt="">
								</i-col>
							</Row>
						</div>
						<span v-else>
							{{ $t('common.none') }}
						</span>
					</i-col>
				</Row>
			</i-col>
		</Row>
	</div>
</template>

<script>
export default {
	name: 'OverallMakeupExpandRow',
	props: {
		row: {
			type: Object,
			default() {
				return {
					assets: [],
				};
			},
		},
	},
	data() {
		return {

		};
	},
	methods: {

	},
};
</script>
